package com.mashibing.singleton;

/**
 跟1差不多
 */
public class Mgro2 {
    private static final Mgro2 INSTANCE;
    static {
        INSTANCE=new Mgro2();
    }
    private Mgro2(){};
    public static Mgro2 getInstance(){return INSTANCE;}
    public void m(){
        System.out.println("m");
    }

    public static void main(String[] args) {
        Mgro2 m1 = Mgro2.getInstance();
        Mgro2 m2 = Mgro2.getInstance();
        System.out.println(m1==m2);
    }
}
